Carbon


PBHDeleteSync

Header: Files.h Carbon status: Supported

Deletes a file or directory.

OSErr PBHDeleteSync (
    HParmBlkPtr paramBlock
);
paramBlock

A pointer to a basic HFS parameter block.

function result

A result code.

DISCUSSION

The relevant fields of the parameter block are:

If the specified target is a file, both forks of the file are deleted. In addition, if a file ID reference for the specified file exists, that file ID reference is also removed.

A file must be closed before you can delete it. Similarly, you cannot delete a directory unless it’s empty. If you attempt to delete an open file or a nonempty directory, PBHDeleteSync returns the result code fBsyErr. PBHDeleteSync also returns fBsyErr if you attempt to delete a directory that has an open working directory associated with it.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)